package com.itheima.reggie.common;

public class UserHolder {

    private static ThreadLocal threadLocal = new ThreadLocal();


    public static void setUserId(Long id){
        threadLocal.set(id);
    }

    public static Long getUserId(){
        Long id = (Long) threadLocal.get();
        return  id;
    }

    public static void release(){
        threadLocal.remove();
    }
}
